package com.lizhi.yun.core.system.controller;

import com.lizhi.common.yun.entity.ListResponseResult;
import com.lizhi.yun.core.system.handler.UppSystemHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @Author: lizhi
 * @Description:
 * @Date: create in 2020/7/10 10:30
 */
@RestController
@RequestMapping(path = "/api/yun/system")
@Api("系统监控")
public class UppSystemController {

    @Resource
    private UppSystemHandler uppSystemHandler;

    @ApiOperation("通过map查询菜单信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "map", value = "map传参", required = false, dataType = "Map", paramType = "query"),
            @ApiImplicitParam(name = "pageIndex", value = "当前页", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "pageSize", value = "展示条数", required = true, dataType = "String", paramType = "query")
    })
    @PostMapping(path = "/doMain")
    public ListResponseResult doMain(@RequestParam Map<String, Object> map, HttpServletRequest request){
        return uppSystemHandler.doMain(map, request);
    }

    @ApiOperation("通过map查询菜单信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "hospitalId", value = "医院ID", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "hospitalSystemId", value = "系统id", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "systemType", value = "系统类别", required = true, dataType = "String", paramType = "query")
    })
    @PostMapping(path = "/findTrainingPatient")
    public ListResponseResult findTrainingPatient(String hospitalId, String hospitalSystemId, String systemType, HttpServletRequest request){
        return uppSystemHandler.findTrainingPatient(hospitalId, hospitalSystemId, systemType, request);
    }

}
